package cn.lyb.service.impl;

import cn.lyb.config.AopLog;
import cn.lyb.service.IService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class ServiceImpl implements IService {
    @Override
    @AopLog("value=getOne")
    public void getOne() {
        log.info("getOne running");
        // 获取当前代理类,调用getAll()方法
        ((IService) AopContext.currentProxy()).getAll();
    }

    @Override
    @AopLog("value=getAll")
    public void getAll() {
        log.info("getAll running");
    }

    @AopLog("value=getById")
    private void getById() {
        log.info("getById running");
    }
}
